* Master file

* Interpreting trends in intergenerational mobility
* Martin Nybom and Jan Stuhler
* December 2023
* Stata/MP 17

clear all
global path "[PATH TO RAW DATA DIRECTORY]"
global path2 "[LOCAL PROJECT PATH]/Clean/"	

* Make directories

cd ${path2}
cap mkdir Logs
cap mkdir Do
cap mkdir Dat

* Create folder for log files
local today = c(current_date)
local today =  subinstr("`today'"," ","_",.)
cap mkdir "${path2}Logs/`today'_Final"
global ver "`today'_Final"

set maxvar 32767
set scrollbufsize 2000000
set more off, permanently

* Generate analysis dataset from raw data
do ${path2}/Do/dataset.do  

* Sample descriptives (Table A.2; Figure 3; Figure A.5)
do ${path2}/Do/descriptive.do  

* Main results (Table 2; Figure A.2; Figure A.6)
do ${path2}/Do/estimation.do  

* Robustness tests (Table A.3; Figure A.7)
do ${path2}/Do/sensitivity_analyses.do  
